#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int arr[((long)RAND_MAX+(long)1)/2]={0};

void fun2(int i) {
    if(i<5) {
        int j = rand()%(sizeof(arr)/sizeof(arr[0])-i)+i;
        int temp = arr[i];
        arr[i] = arr[j];
        arr[j] = temp;
        fun2(i+1);
    }
}

int main()
{
	srand(time(0));
	for(int i=0; i<sizeof(arr)/sizeof(arr[0]); i++) {
		arr[i] = i;
	}
	fun2(0);
	for(int i=0; i<5; i++) {
		printf("%d\n",arr[i]);
	}
	getchar();
	return 0;
}